<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!-- 充值记录页面 -->
<section data-v-16d172c6="" class="main-content czrecord view">
	<div data-v-16d172c6="" class="search"><span data-v-16d172c6="">充值方式：</span>
		<select data-v-16d172c6="" class="select">
			<option data-v-16d172c6="" value="">全部</option>
			<option data-v-16d172c6="" value="1">
				快速充值
			</option>
			<option data-v-16d172c6="" value="2">
				人工扣款
			</option>
		</select> <span data-v-16d172c6="">订单：</span><input class="orderNum" data-v-16d172c6="" placeholder="请输入订单号"> <span data-v-16d172c6="">时间：</span>
		<div data-v-16d172c6="" class="ivu-date-picker">
			<div class="ivu-date-picker-rel">
				<div class="ivu-input-wrapper ivu-input-type ivu-date-picker-editor">
					<input type="text" id="date1" placeholder="开始时间" value=""  class="ivu-input layer-date" readonly="readonly">
					<span style="margin: 0 10px;">至</span>
					<input type="text" id="date2" placeholder="结束时间" value=""  class="ivu-input layer-date" readonly="readonly">		
				</div>
			</div>
			<div class="ivu-select-dropdown" style="display: none;">
				<div></div>
			</div>
		</div> <button data-v-16d172c6="" class="button demand">查询</button></div>
		<table class="class-tableDataTable class-table-needClick display table table-striped table-bordered table-hover " id="khczjl"><!-- table  -->
			<thead data-v-16d172c6="">
				<tr data-v-16d172c6="">
					<th data-v-16d172c6="">订单号</th>
					<th data-v-16d172c6="">充值方式</th>
					<th data-v-16d172c6="">充值金额</th>
					<th data-v-16d172c6="">存款日期</th>
					<th data-v-16d172c6="">状态</th>
				</tr>
			</thead>
		</table>
</section>
<script type="text/javascript">
layui.use('laydate', function() { //layui时间插件
	 laydate= layui.laydate;
	laydate.render({
		elem: '#date1'
	});
	laydate.render({
		elem: '#date2'
	});
}); 
var StartDate //充值记录的开始时间
var EndDate
var orderNum
var model
var s1 = GetDateStr(0);
$("#date1").val(s1);
$("#date2").val(s1);
StartDate = $("#date1").val();
EndDate = $("#date2").val();
model = $(".czrecord .select").find("option:selected").text()
dataTable01()
$(".search .demand").on("click", function() {
	StartDate = $("#date1").val();
	EndDate = $("#date2").val();
	orderNum = $(".czrecord .orderNum").val();
	model = $(".czrecord .select").find("option:selected").text().trim();
	dataTable01();
})	


function dataTable01() { /*充值记录的方法*/
		var oTable = $("#khczjl").DataTable({
			"bProcessing": false, /* 是否显示取数据时的那个等待提示*/
			"bServerSide": true, /*这个用来指明是通过服务端来取数据*/
			"bPaginate": true,/*是否显示分页 */
			"sAjaxSource": "/recharge/findMoneyRecord.do", /*这个是请求的地址*/
			"fnServerData": retrieveData, /* 获取数据的处理函数*/
			"destroy": true,
			"bLengthChange": true,
			"bSort": false,
			"bAutoWidth": false,
			"bServerSide": true,
			'aLengthMenu': [15],
			"searching": false,
			"pagingType": "simple_numbers",
			"dom": "t<'tableinfo'i<'tableSearch'p>l>",

			"language": { /*语言设置  */
				"lengthMenu": "每页显示 _MENU_ 条记录",
				"zeroRecords": "没有检索到数据",
				"sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",
				"info": "没有数据",
				"oPaginate": {
					"sFirst": "首页",
					"sPrevious": "前一页",
					"sNext": "后一页",
					"sLast": "尾页"
				},
				"search": "",
				"searchPlaceholder": "请输入关键字",
				"infoFiltered": "(从  _MAX_ 记录中搜索出结果)",
				"infoEmpty": "没有找到匹配的信息",
			},
			"columnDefs": [{
				"defaultContent": "",
				"targets": "_all"
			}],
			"columns": [{
					"data": "ordernum",
					"className": "ordernum-td"
				},
				{
					"data": "type",
					"className": "type-td"
				},
				{
					"data": "fukuanje",
					"className": "fukuanje-td"
				},
				{
					"data": "sqtime",
					"className": "sqtime-td"
				},
				{
					"data": "state",
					"className": "state-td"
				},
			],
		})

		function retrieveData(sSource, aoData, fnCallback) {
			$.ajax({
				url: sSource,
				data: {
					"pageCount": aoData[0].value,
					"startIndex": aoData[3].value,
					"lineCount": aoData[4].value,
					"type": 2,
					"date1": StartDate,
					"date2": EndDate,
					"orderNum": orderNum,
					"model": model,
				},
				type: 'post',
				dataType: 'json',
				async: false,
				success: function(result) {
					var newJson = result.aaData
					fnCallback(result); 

				},
				error: function(msg) {}
			});
		}
	}
</script>
